<template>
  <div class="page-main">
    <home-nav :userData="userinfo"></home-nav>
    <div class="container" ref="imageWrapper">
      <div class="head-content">
        <span class="bold-font">工程质量通知单</span>
        <div class="btn-line">
          <a-button
            v-if="checkPermission(['WORK_REPORT_ADMIN'])"
            class="hte-btn add-btn"
            type="primary"
            @click="updateStatus"
            >更新审批状态</a-button
          >
          <a-button
            v-if="
              !quality.status ||
              quality.status == '0' ||
              quality.status == '3' ||
              checkPermission(['WORK_REPORT_MANAGER'])
            "
            class="hte-btn add-btn"
            type="primary"
            @click="handleSave"
            >保存</a-button
          >
          <a-button
            v-if="quality.id && (!quality.status || quality.status == '0' || quality.status == '3')"
            class="hte-btn"
            @click="handleSubmit"
            >提交审批</a-button
          >
        </div>
      </div>
      <div class="content">
        <a-form-model ref="ruleForm" :model="quality" :rules="rules">
          <section>
            <div class="section-header">基础信息</div>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-model-item label="质量通知单号:">
                  <a-input v-model="quality.qualityNo" disabled />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="申请人:" prop="applyUser">
                  <a-input v-model="quality.applyUser" disabled />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="申请日期:" prop="applyDate">
                  <a-date-picker disabled valueFormat="YYYY-MM-DD" v-model="quality.applyDate" />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-model-item label="质量通知单名称:" prop="name">
                  <a-input
                    v-model="quality.name"
                    placeholder="质量通知单名称"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="单据类型:" prop="billType">
                  <a-select v-model="quality.billType">
                    <a-select-option
                      v-for="(item, index) in codes.QualityBillType"
                      :key="'billType' + index"
                      :value="item.code"
                      :disabled="
                        !checkPermission(['WORK_REPORT_MANAGER']) &&
                        !(
                          !flow.applyUserId ||
                          (flow.applyUserId == userinfo.info.username &&
                            (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                          (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                        )
                      "
                    >
                      {{ item.name }}
                    </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="申报扣罚金额:" prop="fineAmount">
                  <a-input
                    v-model="quality.fineAmount"
                    placeholder="不扣罚填0"
                    @change="changeFineAmount"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-model-item label="所属合同编号:" prop="contractNo">
                  <a-input-search
                    v-model="quality.contractNo"
                    readOnly
                    @search="showContractSelector = true"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="合同名称:" prop="contractName">
                  <a-input
                    v-model="quality.contractName"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="采购订单号:" prop="poNo">
                  <a-input
                    v-model="quality.poNo"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-model-item label="签订公司/代码:" prop="companyCode">
                  <a-select v-model="quality.companyCode">
                    <a-select-option
                      v-for="(item, index) in signCompany"
                      :key="'companyName' + index"
                      :value="item.componyNo"
                      :disabled="
                        !checkPermission(['WORK_REPORT_MANAGER']) &&
                        !(
                          !flow.applyUserId ||
                          (flow.applyUserId == userinfo.info.username &&
                            (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                          (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                        )
                      "
                    >
                      {{ item.componyName + '/' + item.componyNo }}
                    </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="供应商/编码:" prop="supplier">
                  <a-input-search
                    v-model="quality.supplier"
                    readOnly
                    @change="changeSupplier"
                    @search="showSupplierSelector = true"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>

              <!-- <a-col :span="8">
                <a-form-model-item label="费用支出号:" prop="wbs">
                  <a-input v-model="quality.wbs" />
                </a-form-model-item>
              </a-col> -->
              <a-col :span="8">
                <a-form-model-item label="合同签订人:" prop="signUser">
                  <UserInputSelector
                    :username.sync="quality.signUserId"
                    :realname.sync="quality.signUser"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                    multiple="multiple"
                    placeholder="请选择"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-model-item label="违约/扣罚类型:" prop="qualityTypeArr">
                  <a-select mode="multiple" v-model="quality.qualityTypeArr">
                    <a-select-option
                      v-for="(item, index) in codes.QualityType"
                      :key="'type' + index"
                      :value="item.code"
                      :disabled="
                        !checkPermission(['WORK_REPORT_MANAGER']) &&
                        !(
                          !flow.applyUserId ||
                          (flow.applyUserId == userinfo.info.username &&
                            (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                          (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                        )
                      "
                    >
                      {{ item.name }}
                    </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
            </a-row>
            <div v-if="quality.qualityTypeArr && quality.qualityTypeArr.length > 0">
              <a-row :gutter="24" v-for="(type, index) in quality.qualityTypeArr" :key="'qualityTypeArr' + index">
                <a-col :span="24">
                  <a-form-model-item :label="getTypeName(type)" :prop="'type' + type">
                    <div style="display: flex">
                      <a-select
                        mode="multiple"
                        v-model="quality['typeArr' + type]"
                        @change="changeQualityType"
                        :disabled="
                          !checkPermission(['WORK_REPORT_MANAGER']) &&
                          !(
                            !flow.applyUserId ||
                            (flow.applyUserId == userinfo.info.username &&
                              (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                            (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                          )
                        "
                      >
                        <template v-for="item in codes['QualityTypeScore' + type]">
                          <a-select-option
                            v-for="(opt, index) in codes['QualityTypeScore' + type + '_' + item.code]"
                            :key="'typeA' + type + '_' + '_' + item.code + index"
                            :value="opt.code"
                          >
                            {{ opt.name }}({{ item.name }})
                          </a-select-option>
                        </template>
                      </a-select>
                      <a-input
                        :value="quality['typeScore' + type] ? '分值:' + quality['typeScore' + type] + '分' : '分值:0分'"
                        style="width: 120px; text-align: center"
                        disabled
                      />
                    </div>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <a-row :gutter="24" v-if="quality.type4 && quality.type4.indexOf('3') > -1">
              <a-col :span="8">
                <a-form-model-item
                  label="我司影响天数"
                  :prop="quality.type4 && quality.type4.indexOf('3') > -1 ? 'partaDelayDays' : ''"
                >
                  <a-input
                    v-model="quality.partaDelayDays"
                    style="width: 100%"
                    placeholder="我司影响天数"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        flow.applyUserId == userinfo.info.username ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item
                  label="供应商影响天数"
                  :prop="quality.type4 && quality.type4.indexOf('3') > -1 ? 'partbDelayDays' : ''"
                >
                  <a-input
                    v-model="quality.partbDelayDays"
                    style="width: 100%"
                    placeholder="供应商影响天数"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item
                  label="逾期对我司影响情况"
                  :prop="quality.type4 && quality.type4.indexOf('3') > -1 ? 'partaEffect' : ''"
                >
                  <a-input
                    v-model="quality.partaEffect"
                    style="width: 100%"
                    placeholder="逾期对我司影响情况"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'followUser' && flow.followUserId == userinfo.info.username)
                      )
                    "
                  />
                </a-form-model-item>
              </a-col>
            </a-row>

            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-model-item
                  label="主要内容描述"
                  :prop="
                    !flow.applyUserId ||
                    (process.taskDefKey == 'applyUser' && flow.applyUserId == userinfo.info.username)
                      ? 'content'
                      : ''
                  "
                >
                  <a-input
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'applyUser' && flow.applyUserId == userinfo.info.username)
                      )
                    "
                    v-model="quality.content"
                    style="width: 100%"
                    placeholder="主要内容描述"
                    type="textarea"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-model-item
                  label="处理要求建议"
                  :prop="
                    !flow.applyUserId ||
                    (flow.applyUserId == userinfo.info.username &&
                      (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                    (process.taskDefKey == 'applyUser' && flow.applyUserId == userinfo.info.username)
                      ? 'content'
                      : ''
                  "
                >
                  <a-input
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        !flow.applyUserId ||
                        (flow.applyUserId == userinfo.info.username &&
                          (!process.taskDefKey || process.taskDefKey == 'applyUser')) ||
                        (process.taskDefKey == 'applyUser' && flow.applyUserId == userinfo.info.username)
                      )
                    "
                    v-model="quality.suggest"
                    style="width: 100%"
                    placeholder="处理要求建议"
                    type="textarea"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-model-item label="备注说明" prop="remark">
                  <a-input
                    v-model="quality.remark"
                    style="width: 100%"
                    :disabled="!checkPermission(['WORK_REPORT_MANAGER'])"
                    type="textarea"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
          </section>
          <section>
            <div class="section-header">
              <div>
                合同相关处理<span style="font-size: 12px; color: red; padding-left: 20px; font-weight: normal"
                  >此部分信息由合同跟进人、合同签订人、结算员联合处理</span
                >
              </div>
              <div>
                <a-button
                  v-if="
                    process.taskDefKey == 'followUser' ||
                    process.taskDefKey == 'followUser1' ||
                    process.taskDefKey == 'signUser' ||
                    (process.taskDefKey == 'relationUser' &&
                      process.assignees &&
                      process.assignees.indexOf(userinfo.info.username) > -1 &&
                      userinfo.info.username == flow.settlementUserId)
                  "
                  class="hte-btn add-btn"
                  type="primary"
                  @click="handleSave1()"
                  >保存</a-button
                >
              </div>
            </div>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-model-item label="是否扣罚:" prop="fineType">
                  <a-select
                    v-model="quality.fineType"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(process.taskDefKey == 'followUser' || process.taskDefKey == 'followUser1')
                    "
                    @change="changeFineType"
                  >
                    <a-select-option
                      v-for="(item, index) in codes.QualityFineType"
                      :key="'fineType' + index"
                      :value="item.code"
                    >
                      {{ item.name }}
                    </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="外发函件单号:" prop="qualityNum">
                  <a-input
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(process.taskDefKey == 'followUser' || process.taskDefKey == 'followUser1')
                    "
                    v-model="quality.qualityNum"
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="按合同约定罚金:" prop="fileAmount">
                  <a-input
                    placeholder="按合同约定罚金"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(process.taskDefKey == 'followUser' || process.taskDefKey == 'followUser1')
                    "
                    v-model="quality.partbFineAmount"
                    @change="changePartbFineAmount"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <a-row :gutter="24" v-if="quality.fineType == '2'">
              <a-col :span="8">
                <a-form-model-item label="扣罚方式:" prop="fineMethod">
                  <a-select
                    v-model="quality.fineMethod"
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        process.taskDefKey == 'followUser' ||
                        process.taskDefKey == 'followUser1' ||
                        process.taskDefKey == 'signUser' ||
                        (process.taskDefKey == 'relationUser' &&
                          process.assignees &&
                          process.assignees.indexOf(userinfo.info.username) > -1 &&
                          userinfo.info.username == flow.settlementUserId)
                      )
                    "
                  >
                    <a-select-option
                      v-for="(item, index) in codes.QualityFineMethod"
                      :key="'fineMethod' + index"
                      :value="item.code"
                    >
                      {{ item.name }}
                    </a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="财务收据号:" prop="receiptNo">
                  <a-input
                    :disabled="
                      !checkPermission(['WORK_REPORT_MANAGER']) &&
                      !(
                        process.taskDefKey == 'followUser' ||
                        process.taskDefKey == 'followUser1' ||
                        process.taskDefKey == 'signUser' ||
                        (process.taskDefKey == 'relationUser' &&
                          process.assignees &&
                          process.assignees.indexOf(userinfo.info.username) > -1 &&
                          userinfo.info.username == flow.settlementUserId)
                      )
                    "
                    v-model="quality.receiptNo"
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="经审批扣罚金额:" prop="fileAmount">
                  <a-input
                    placeholder="经审批扣罚金额"
                    :disabled="!checkPermission(['WORK_REPORT_MANAGER']) && !(process.taskDefKey == 'signUser')"
                    v-model="quality.spFineAmount"
                    @change="changeSpFineAmount"
                  />
                </a-form-model-item>
              </a-col>
            </a-row>
            <QualityFinePoList
              v-if="quality.fineType == '2' && quality.fineMethod == '2'"
              ref="poListRef"
              :quality="quality"
              :permission="permission"
              :process="process"
              :flow="flow"
            />
            <div
              v-if="
                [
                  'followUser',
                  'meetingUser',
                  'followUser1',
                  'signUser',
                  'signHeader',
                  'signHeader1',
                  'relationUser',
                  'mojarHeader',
                  'mojarHeader1',
                  'chargeLeader',
                  'chargeLeader1',
                ].indexOf(process.taskDefKey) > -1
              "
            >
              <a-row :gutter="24">
                <a-col :span="6">
                  <a-form-model-item label="是否需要相关处理:">
                    <a-radio-group
                      v-model="custom.needRelateUser"
                      @change="changeNeedRelateUser"
                      :disabled="!(['followUser', 'followUser1'].indexOf(process.taskDefKey) > -1)"
                    >
                      <a-radio-button value="1"> 是 </a-radio-button>
                      <a-radio-button value="0"> 否 </a-radio-button>
                    </a-radio-group>
                  </a-form-model-item>
                </a-col>
                <a-col :span="6">
                  <a-form-model-item label="结算员:">
                    <UserInputSelector
                      :username.sync="custom.settlementUserId"
                      :realname.sync="custom.settlementUser"
                      :disabled="!(['followUser', 'followUser1'].indexOf(process.taskDefKey) > -1)"
                      multiple="multiple"
                      placeholder="请选择"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="6">
                  <a-form-model-item label="PS专员:">
                    <UserInputSelector
                      :username.sync="custom.psUserId"
                      :realname.sync="custom.psUser"
                      :disabled="!(['followUser', 'followUser1'].indexOf(process.taskDefKey) > -1)"
                      multiple="multiple"
                      placeholder="请选择"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="6">
                  <a-form-model-item label="项目负责人">
                    <UserInputSelector
                      :username.sync="custom.relateProjectHeaderId"
                      :realname.sync="custom.relateProjectHeader"
                      :disabled="!(['followUser', 'followUser1'].indexOf(process.taskDefKey) > -1)"
                      multiple="multiple"
                      placeholder="请选择"
                    />
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
          </section>
          <section>
            <div class="section-header">
              <div>
                附件信息<span style="font-size: 12px; color: red; padding-left: 20px; font-weight: normal"
                  >请保存表单数据后再上传附件</span
                >
              </div>
            </div>
            <WorkAttachList
              busType="quality"
              :busKey="quality.id ? +quality.id + '' : ''"
              :permission="permission"
              :quality="quality"
              :formName="process.taskDefKey"
              ref="attachBox"
            />
          </section>
          <section v-if="quality.oaLsh">
            <div class="section-header">审批记录</div>
            <ht-approval
              ref="childrenRef"
              :process-instance-id="quality.oaLsh"
              :custom="custom"
              :options="options"
              @submit="afterSubmit"
              @reject="afterReject"
              @back="backAction"
              @cancelSubmit="afterCancelSubmit"
              :before-fill-opinion="saveNotifyOpinion"
              :before-submit="beforeSubmit"
              :before-reject="beforeReject"
              :show-task-history="true"
              :history-dialog="historyDialog"
              :task-load="taskLoad"
              :message-id="messageId"
              :showPrintBtn="showPrintBtn"
              :show-upload-btn="false"
              :hidden-task-def-key="hiddenTaskDefKey"
              :print="print"
              :snapshotConfigs="snapshotConfigs"
            >
            </ht-approval>
            <a-modal
              title="请确认"
              :visible="showRelationUserTips"
              @ok="handlerOk"
              @cancel="showRelationUserTips = false"
              width="500px"
              :maskClosable="false"
            >
              {{ tips }}
            </a-modal>
          </section>
        </a-form-model>
      </div>
    </div>
    <ProcessUserSelect ref="ProcessUserSelect" @selectUserConfirm="selectUserConfirm" />
    <SupplierSelector :show="showSupplierSelector" @close="selectSupplier" />
    <ContractSelector :show="showContractSelector" @close="selectContract" />
  </div>
</template>

<script>
import { getAction, postAction, postActionAsync } from '@/api/manage'
import { FlowMixin } from '@/mixins/FlowMixin'
import { Modal } from 'ant-design-vue'
export default {
  mixins: [FlowMixin],
  components: {
    HomeNav: () => import('@/components/layouts/HomeNav'),
    htApproval: () => import('@/config/ht-approval.umd.min.js'),
    WorkAttachList: () => import('@/views/workReport/attach/WorkAttachList'),
    ProcessUserSelect: () => import('@/components/tools/ProcessUserSelect'),
    QualityFinePoList: () => import('@/views/workReport/quality/QualityFinePoList'),
    SupplierSelector: () => import('@/views/workReport/util/SupplierSelector'),
    ContractSelector: () => import('@/views/workReport/util/ContractSelector'),
  },
  props: {
    qualityId: {
      type: String,
      default: null,
    },
    taskId: {
      type: String,
      default: null,
    },
    editType: {
      type: String,
      default: 'edit',
    },
  },
  data() {
    return {
      snapshotConfigs: [
        {
          type: 'ref',
          value: 'imageWrapper',
        },
      ],
      showRelationUserTips: false,
      userinfo: {
        info: this.$store.getters.userInfo,
        module: 'ContractReportInfo',
      },
      billTypeOptions: [
        { value: 1, label: '扣罚类(含非扣罚的质量问题)' },
        { value: 2, label: '非扣罚类' },
      ],
      qualityTypeOptions: [
        { value: '1', label: '质量投诉' },
        { value: '2', label: '现场管理投诉' },
        { value: '3', label: '安全事故' },
        { value: '4', label: '进度' },
        { value: '5', label: '延期申请' },
      ],
      urls: {
        psQualityInfo: '/hte/contract/qualityInfo',
        qualityInfo: '/workReport/quality/info',
        qualitySave: '/workReport/quality/edit',
        task: '/workReport/task/info',
        project: '/workReport/project/info',
        payment: '/workReport/payment/infoByTask',
        myPermission: '/workReport/project/myPermission',
        personList: '/person/info/personList',
        getProcess: '/workReport/payment/getProcess',
        codes: '/manage/codeInfo/queryByTypes',
        loadSignCompany: '/hte/contract/loadSignCompany',
        updateFlow: '/workReport/quality/updateStatus/' + this.qualityId,
      },
      approvalActions: {
        updateStatus: '/workReport/quality/updateStatus/' + this.qualityId,
      },
      rules: {
        fineAmount: [{ required: true, message: '请输入', trigger: 'blur' }],
        contractNo: [{ required: true, message: '请输入', trigger: 'blur' }],
        contractName: [{ required: true, message: '请输入', trigger: 'blur' }],
        name: [{ required: true, message: '请输入', trigger: 'blur' }],
        poNo: [{ required: true, message: '请输入', trigger: 'blur' }],
        companyCode: [{ required: true, message: '请选择', trigger: 'blur' }],
        supplier: [{ required: true, message: '请选择', trigger: 'blur' }],
        qualityTypeArr: [{ required: true, message: '请选择', trigger: 'blur' }],
        type1: [{ required: true, message: '请选择', trigger: 'blur' }],
        type2: [{ required: true, message: '请选择', trigger: 'blur' }],
        type3: [{ required: true, message: '请选择', trigger: 'blur' }],
        type4: [{ required: true, message: '请选择', trigger: 'blur' }],
        suggest: [{ required: true, message: '请选择', trigger: 'blur' }],
        billType: [{ required: true, message: '请选择', trigger: 'blur' }],
        partaDelayDays: [{ required: true, message: '请输入', trigger: 'blur' }],
        partbDelayDays: [{ required: true, message: '请输入', trigger: 'blur' }],
        partaEffect: [{ required: true, message: '请输入', trigger: 'blur' }],
        content: [{ required: true, message: '请输入', trigger: 'blur' }],
      },
      quality: { fineType: '2', fineMethod: '2', fineAmount: 0, partbFineAmount: '', spFineAmount: '' },
      task: {},
      project: {},
      permission: [],
      showFlowForm: false,
      custom: {},
      flow: {},
      personList: [],
      personMap: {},
      existPersonMap: {},
      process: { taskDefKey: '' },
      codes: {},
      signCompany: {},
      showSupplierSelector: false,
      showContractSelector: false,
      selectUserKeyWord: null,
      selectUserTimeOut: null,
    }
  },
  async mounted() {
    this.init()
  },
  methods: {
    async init() {
      this.initQuality()
      this.fetchSignCompany()
      await this.fetchCodes()
      if (this.qualityId) {
        this.fetchQuality()
      }
      if (this.taskId) {
        this.fetchTask(this.taskId)
      }
      this.fetchPermission()
    },
    fetchCodes() {
      let types = []
      types.push('QualityFineMethod')
      types.push('QualityFineType')
      types.push('QualityBillType')
      types.push('QualityType')
      types.push('QualityTypeScore1')
      types.push('QualityTypeScore1_1')
      types.push('QualityTypeScore1_3')
      types.push('QualityTypeScore1_5')
      types.push('QualityTypeScore2')
      types.push('QualityTypeScore2_1')
      types.push('QualityTypeScore2_3')
      types.push('QualityTypeScore2_5')
      types.push('QualityTypeScore3')
      types.push('QualityTypeScore3_10')
      types.push('QualityTypeScore3_20')
      types.push('QualityTypeScore3_30')
      types.push('QualityTypeScore3_100')
      types.push('QualityTypeScore4')
      types.push('QualityTypeScore4_0')
      types.push('QualityTypeScore4_10')
      types.push('QualityTypeScore5')
      types.push('QualityTypeScore5_0')
      getAction(this.urls.codes, { types: types.join(',') }).then((res) => {
        if (res.success) {
          this.codes = { ...this.codes, ...res.result }
          this.calcTypeScore()
        }
      })
    },
    fetchPermission() {
      getAction(this.urls.myPermission, { projectId: this.task.projectId ? this.task.projectId : '' }).then((res) => {
        if (res.success) {
          this.permission = res.result
        }
      })
    },
    fetchTask(taskId) {
      getAction(this.urls.task + '/' + taskId, {}).then((res) => {
        if (res.success) {
          this.task = res.result
          if (this.task.projectId) {
            this.fetchProject()
            this.initQuality()
            this.fetchPermission()
          }
        }
      })
    },
    fetchProject() {
      getAction(this.urls.project + '/' + this.task.projectId, {}).then((res) => {
        if (res.success) {
          this.project = res.result
          if (this.project.id) {
            this.initQuality()
          }
        }
      })
    },
    initQuality() {
      this.$set(this.quality, 'contractNo', this.project.contractNumber || '')
      this.$set(this.quality, 'contractName', this.project.contractName || '')
      this.$set(this.quality, 'supplierCode', this.project.supplierCode || '')
      this.$set(this.quality, 'supplierName', this.project.supplierName || '')
      this.$set(this.quality, 'companyName', this.project.signCompany || '')
      this.$set(this.quality, 'companyCode', this.project.signCompanyCode || '')
      this.$set(this.quality, 'signUser', this.project.signUser || '')
      this.$set(this.quality, 'signUserId', this.project.signUserId || '')
      this.$set(this.quality, 'poNo', this.project.busKey || '')
      this.$set(this.quality, 'wbs', this.task.costNumber || '')
      if (this.quality.qualityType) {
        this.$set(this.quality, 'qualityTypeArr', this.quality.qualityType.split(','))
      } else {
        this.$set(this.quality, 'qualityTypeArr', [])
      }
      if (this.quality.supplierCode && this.quality.supplierName) {
        this.$set(this.quality, 'supplier', this.quality.supplierName + '/' + this.quality.supplierCode)
      } else {
        this.$set(this.quality, 'supplier', '')
      }
    },
    fetchQuality() {
      getAction(this.urls.qualityInfo + '/' + this.qualityId, {}).then((res) => {
        if (res.success) {
          this.quality = res.result
          if (this.quality.qualityType) {
            this.$set(this.quality, 'qualityTypeArr', this.quality.qualityType.split(','))
          }
          if (this.quality.type1) {
            this.$set(this.quality, 'typeArr1', this.quality.type1.split(','))
          }
          if (this.quality.type2) {
            this.$set(this.quality, 'typeArr2', this.quality.type2.split(','))
          }
          if (this.quality.type3) {
            this.$set(this.quality, 'typeArr3', this.quality.type3.split(','))
          }
          if (this.quality.type4) {
            this.$set(this.quality, 'typeArr4', this.quality.type4.split(','))
          }
          if (this.quality.type5) {
            this.$set(this.quality, 'typeArr5', this.quality.type5.split(','))
          }
          this.$set(this.quality, 'billType', this.quality.billType ? this.quality.billType + '' : '')
          if (this.quality.supplierName && this.quality.supplierCode) {
            this.$set(this.quality, 'supplier', this.quality.supplierName + '/' + this.quality.supplierCode)
          } else {
            this.$set(this.quality, 'supplier')
          }
          this.$set(this.custom, 'needRelateUser', this.quality.needRelateUser ? this.quality.needRelateUser + '' : '1')
              this.$set(this.custom, 'settlementUser', this.quality.settlementUser)
              this.$set(this.custom, 'settlementUserId', this.quality.settlementUserId)
              this.$set(this.custom, 'psUser', this.quality.psUser)
              this.$set(this.custom, 'psUserId', this.quality.psUserId)
              this.$set(this.custom, 'relateProjectHeader', this.quality.relateProjectHeader)
              this.$set(this.custom, 'relateProjectHeaderId', this.quality.relateProjectHeaderId)
          if (this.quality.oaLsh) {
            this.fetchProcess(this.quality.oaLsh)
          }
          if (this.quality.taskId) {
            this.fetchTask(this.quality.taskId)
          }

          this.calcTypeScore()
        }
      })
    },
    doUpdateFlow() {
      let param = {}
      if (this.quality.handlerStepKey == 'followUser') {
        param = this.custom
      }
      postAction(this.urls.updateFlow, param).then((res) => {
        if (res.code == 200) {
          this.fetchQuality()
          this.fetchProcess(this.quality.oaLsh)
        } else {
          this.$messageWorkReport.warning('流程审批退回接口异常:' + res.message)
        }
      })
    },
    doUpdateStatus() {
      let param = {}
      if (['followUser', 'followUser1'].indexOf(this.process.taskDefKey) > -1) {
        param = this.custom
        this.handleSave()
        this.doUpdateFlow()
      }
      postAction(this.approvalActions.updateStatus, param).then((res) => {
        if (res.code == 200) {
          this.fetchQuality()
          this.fetchProcess(this.quality.oaLsh)
        } else {
          this.$messageWorkReport.warning('流程审批退回接口异常:' + res.message)
        }
      })
    },
    handleSave1() {
      if (this.quality.fineType == '2') {
        if (!this.quality.qualityNum) {
          return this.$messageWorkReport.warning('请输入外发函件单号')
        }
        if (!this.quality.partbFineAmount) {
          return this.$messageWorkReport.warning('请输入按合同约定罚金')
        }
        if (!this.quality.fineMethod) {
          return this.$messageWorkReport.warning('请选择扣罚方式')
        }
        if (this.quality.fineMethod == '1') {
          if (!this.quality.receiptNo) {
            return this.$messageWorkReport.warning('请输入财务收据号')
          }

          if (this.process.taskDefKey == 'signUser') {
            if (!this.quality.spFineAmount) {
              return this.$messageWorkReport.warning('请输入经审批扣罚金额')
            }
          }
        }
        if (this.quality.fineMethod == '2') {
          this.$refs.poListRef.checkFinePo()
          let records = this.$refs.poListRef.getFinePo()
          let line = []
          let flat = true
          for (let i = 0; i < records.length; i++) {
            let record = records[i]
            if (!record.poNo || !record.poLine || !record.fineAmountType || !record.reduce) {
              line.push(i + 1)
              flat = false
            }
          }
          if (!flat) {
            this.$messageWorkReport.warning('请完成填写行[' + line.join(',') + ']')
            return false
          }
          if (this.process.taskDefKey == 'signUser') {
            for (let i = 0; i < records.length; i++) {
              let record = records[i]
              if (!record.reduce) {
                line.push(i + 1)
                flat = false
              }
            }
            if (!flat) {
              this.$messageWorkReport.warning('请完成填写行[' + line.join(',') + ']')
              return false
            }
          }
          if (records && records.length > 0) {
            this.$set(this.quality, 'finePo', JSON.stringify(records))
          } else {
            this.$set(this.quality, 'finePo', '')
          }
        }
      }
      this.doUpdateFlow()
      this.handleSave()
    },
    handleCheck() {
      if (!this.quality.qualityTypeArr) {
        this.$set(this.quality, 'qualityTypeArr', [])
      }
      this.$set(this.quality, 'qualityType', this.quality.qualityTypeArr.join(','))
      this.$set(this.quality, 'taskId', this.task.id)
      this.$set(this.quality, 'status', 0)
      this.changeQualityType()
      if (!this.quality.name) {
        this.$messageWorkReport.warning('请输入名称')
        return false
      }
      if (!this.quality.billType) {
        this.$messageWorkReport.warning('请选择单据类型')
        return false
      }
      if (!this.quality.content) {
        this.$messageWorkReport.warning('请选择主要内容')
        return false
      }
      if (this.quality.type4 && this.quality.type4.indexOf('2') > -1) {
        if (!this.quality.partaDelayDays) {
          this.$messageWorkReport.warning('请输入我司影响天数')
          return false
        }
        if (!this.quality.partbDelayDays) {
          this.$messageWorkReport.warning('请输入供应商影响天数')
          return false
        }
        if (!this.quality.partaEffect) {
          this.$messageWorkReport.warning('请输入逾期对我司影响')
          return false
        }
      }
      if (
        this.process.taskDefKey == 'followUser' ||
        this.process.taskDefKey == 'followUser1' ||
        this.process.taskDefKey == 'signUser' ||
        (this.process.taskDefKey == 'relationUser' &&
          this.process.assignees &&
          this.process.assignees.indexOf(this.userinfo.info.username) > -1 &&
          this.userinfo.info.username == this.flow.settlementUserId)
      ) {
        if (this.quality.fineType == '2') {
          if (this.quality.fineMethod != '1') {
            this.$refs.poListRef.checkFinePo()
            let records = this.$refs.poListRef.getFinePo()
            let line = []
            let flat = true
            for (let i = 0; i < records.length; i++) {
              let record = records[i]
              if (!record.poNo || !record.poLine || !record.fineAmountType || !record.reduce) {
                line.push(i + 1)
                flat = false
              }
            }
            if (!flat) {
              this.$messageWorkReport.warning('请完成填写行[' + line.join(',') + ']')
              return false
            }
            if (this.process.taskDefKey == 'signUser') {
              for (let i = 0; i < records.length; i++) {
                let record = records[i]
                if (!record.reduce) {
                  line.push(i + 1)
                  flat = false
                }
              }
              if (!flat) {
                this.$messageWorkReport.warning('请完成填写行[' + line.join(',') + ']')
                return false
              }
            }
            if (records && records.length > 0) {
              this.$set(this.quality, 'finePo', JSON.stringify(records))
            } else {
              this.$set(this.quality, 'finePo', '')
            }
          } else if (!this.quality.receiptNo) {
            this.$messageWorkReport.warning('请财务收据号')
            return false
          }
        }
      }
      this.$refs.ruleForm.validate((valid) => {
        if (!valid) {
          return false
        } else {
          return true
        }
      })
      return true
    },
    handleSave() {
      if (this.handleCheck()) {
        postAction(this.urls.qualitySave, this.quality).then((res) => {
          if (res.success) {
            this.quality = res.result
            this.fetchQuality()
            this.$messageWorkReport.success('保存成功')
            if (this.editType == 'add') {
              let urlJump = this.$router.resolve({ path:'/workReport/quality/edit/' + this.quality.id })
              window.open(urlJump.href, '_blank')
              window.close()
            } else {
              this.init()
            }
          } else {
            this.$messageWorkReport.error(res.message)
          }
        })
      }
    },
    handleSubmit() {
      let attachs = this.$refs.attachBox.getAttach()
      if (!attachs || attachs.length <= 0) {
        return this.$messageWorkReport.warning('请下载质量通知单模板,按模板要求填写。')
      }
      this.openProcessUserSelect()
    },
    openProcessUserSelect() {
      getAction(this.urls.flowNode + '?id=' + this.quality.id).then((res) => {
        if (res.success) {
          this.$refs.ProcessUserSelect.doSelect(res.result)
        } else {
          this.$messageWorkReport.error(res.message)
        }
        this.disableBtn = false
      })
    },
    selectUserConfirm(cols) {
      if (this.process.taskDefKey == 'applyUser') {
        cols.forEach(c => {
          if (c.value && c.value != null) {
            this.$set(this.custom, c.node, c.value)
          } else {
            this.$set(this.custom, c.node, '')
          }
        })
        this.$refs.childrenRef.custom = this.custom
        this.$refs.childrenRef.submitTaskNotBefore()
        return
      }
      postAction(this.urls.startFlow + '?id=' + this.quality.id, cols).then((res) => {
        if (res.success) {
          this.$messageWorkReport.success('提交成功')
          this.$router.go(0)
        } else {
          this.$messageWorkReport.error(res.message)
        }
        this.disableBtn = false
      })
    },
    closeFlowForm() {
      this.init()
      this.showFlowForm = false
    },
    clickPersonSelector(type, mutil) {
      this.currentType = type
      this.mutil = mutil
      let usernames = this.custom[type + 'Id'] ? this.custom[type + 'Id'].split(',') : []
      let realnames = this.custom[type] ? this.custom[type].split(',') : []
      for (let i = 0; i < realnames.length; i++) {
        this.$set(this.existPersonMap, realnames[i], usernames[i])
      }
    },
    changeIsEndNode() {
      this.$set(this.custom, 'needRelateUser', '0')
      this.$set(this.custom, 'settlementUser', '')
      this.$set(this.custom, 'settlementUserId', '')
      this.$set(this.custom, 'psUser', '')
      this.$set(this.custom, 'psUserId', '')
      this.$set(this.custom, 'relateProjectHeader', '')
      this.$set(this.custom, 'relateProjectHeaderId', '')
    },
    changeNeedMojarMeetingUser() {
      // this.$set(this.custom, 'meetingUser', '')
      // this.$set(this.custom, 'meetingUserId', '')
    },
    changeNeedRelateUser() {
      this.$set(this.custom, 'settlementUser', '')
      this.$set(this.custom, 'settlementUserId', '')
      this.$set(this.custom, 'psUser', '')
      this.$set(this.custom, 'psUserId', '')
      this.$set(this.custom, 'relateProjectHeader', '')
      this.$set(this.custom, 'relateProjectHeaderId', '')
    },
    fetchProcess(flowId) {
      getAction(this.urls.getProcess + '/' + flowId, {}).then((res) => {
        if (res.success) {
          this.process = res.result
          if (!this.process) {
            this.process = { taskDefKey: '' }
          }
          this.$set(this.quality, 'handlerStepKey', res.result ? res.result.taskDefKey : '')
        } else {
          this.$messageWorkReport.error(res.message)
        }
      })
    },
    reflashFlow() {
      this.fetchProcess(this.quality.oaLsh)
    },
    fetchPermission() {
      getAction(this.urls.myPermission, { projectId: this.task.projectId }).then((res) => {
        if (res.success) {
          this.permission = res.result
        }
      })
    },
    checkPermission(powers) {
      let hasPower = false
      for (let p of powers) {
        if (this.permission.indexOf(p) > -1) {
          hasPower = true
          break
        }
      }
      return hasPower
    },
    getTypeName(type) {
      let name = ''
      this.qualityTypeOptions.forEach((t) => {
        if (t.value == type) {
          name = t.label + '：'
        }
      })
      return name
    },
    changeQualityType() {
      if (this.quality.typeArr1) {
        this.$set(this.quality, 'type1', this.quality.typeArr1.join(','))
      }
      if (this.quality.typeArr2) {
        this.$set(this.quality, 'type2', this.quality.typeArr2.join(','))
      }
      if (this.quality.typeArr3) {
        this.$set(this.quality, 'type3', this.quality.typeArr3.join(','))
      }
      if (this.quality.typeArr4) {
        this.$set(this.quality, 'type4', this.quality.typeArr4.join(','))
      }
      if (this.quality.typeArr5) {
        this.$set(this.quality, 'type5', this.quality.typeArr5.join(','))
      }
      this.calcTypeScore()
    },
    calcTypeScore() {
      let arr = ['1', '2', '3', '4', '5']
      arr.forEach((index) => {
        let type = this.quality['typeArr' + index]
        let typeScore = 0
        if (type) {
          let prefixKey = 'QualityTypeScore' + index + '_'
          for (let key in this.codes) {
            if (key.startsWith(prefixKey)) {
              let dict = this.codes[key]
              dict.forEach((d) => {
                if (type.indexOf(d.code) > -1) {
                  typeScore += parseInt(d.type.split('_')[1])
                }
              })
            }
          }
        }
        this.$set(this.quality, 'typeScore' + index, typeScore)
      })
    },
    async updateStatus() {
      await postActionAsync(this.approvalActions.updateStatus, {}).then((res) => {
        if (res.code == 200) {
          this.$messageWorkReport.success('更新成功')
        } else {
          this.$messageWorkReport.warning('流程审批通过接口异常:' + res.message)
        }
      })
    },
    fetchSignCompany() {
      getAction(this.urls.loadSignCompany, {}).then((res) => {
        if (res.code == 200) {
          this.signCompany = res.result
        } else {
          this.$messageWorkReport.warning('请求数据失败:' + res.msg)
        }
      })
    },
    selectSupplier(supplier) {
      if (supplier) {
        this.$set(this.quality, 'supplierName', supplier.sp_name)
        this.$set(this.quality, 'supplierCode', supplier.sp_no)
        this.$set(this.quality, 'supplier', supplier.sp_name + '/' + supplier.sp_no)
      } else {
        this.$set(this.quality, 'supplierName', '')
        this.$set(this.quality, 'supplierCode', '')
        this.$set(this.quality, 'supplier', '')
      }
      this.showSupplierSelector = false
    },
    selectContract(contract) {
      if (contract) {
        this.$set(this.quality, 'supplierName', contract.supplierName)
        this.$set(this.quality, 'supplierCode', contract.supplierCode)
        this.$set(this.quality, 'supplier', contract.supplierName + '/' + contract.supplierCode)
        this.$set(this.quality, 'companyName', contract.signCompany)
        this.$set(this.quality, 'companyCode', contract.signCompanyCode)
        this.$set(
          this.quality,
          'poNo',
          contract.purchaseOrderNumber ? contract.purchaseOrderNumber : contract.contractOrderNumber
        )
        this.$set(this.quality, 'signUser', contract.createUser)
        this.$set(this.quality, 'signUserId', contract.createUserId)
        this.$set(this.quality, 'contractName', contract.contractName)
        this.$set(this.quality, 'contractNo', contract.contractNumber)
      } else {
        this.$set(this.quality, 'supplierName', '')
        this.$set(this.quality, 'supplierCode', '')
        this.$set(this.quality, 'supplier', '')
        this.$set(this.quality, 'signCompany', '')
        this.$set(this.quality, 'signCompanyCode', '')
        this.$set(this.quality, 'poNo', '')
        this.$set(this.quality, 'signUser', '')
        this.$set(this.quality, 'signUserId', '')
        this.$set(this.quality, 'contractName', '')
        this.$set(this.quality, 'contractNo', '')
      }
      this.showContractSelector = false
    },
    changeSupplier() {
      if (!this.quality.supplierName || !this.quality.supplierCode) {
        this.$set(this.quality, 'supplierName', '')
        this.$set(this.quality, 'supplierCode', '')
      }
    },
    confirmRelation() {
      let title = '当前为'
      if (this.quality.needRelateUser == '0') {
        title += '[不需要相关处理人]'
      }
      if (this.quality.needRelateUser == '1') {
        if (!this.quality.settlementUserId || !this.quality.psUserId || !this.quality.relateProjectHeaderId) {
          this.$messageWorkReport.warning('请至少选一个相关处理人')
          return false
        }
        title += '[需要相关处理人]'
        if (this.quality.settlementUser) {
          title += '[结算员:' + this.quality.settlementUser + ']'
        }
        if (this.quality.psUser) {
          title += '[PS专员:' + this.quality.settlementUser + ']'
        }
        if (this.quality.relateProjectHeader) {
          title += '[项目负责人:' + this.quality.relateProjectHeader + ']'
        }
      }
      Modal.confirm({
        content: `${title} 请确认？`,
        onOk: () => {
          return true
        },
        onCancel() {
          return false
        },
      })
    },
    changeFineAmount() {
      if (!this.quality.fineAmount || isNaN(this.quality.fineAmount)) {
        this.$messageWorkReport.warning('申报扣罚金额请输入数值类型数据')
        this.$set(this.quality, 'fineAmount', 0)
      }
    },
    changePartbFineAmount() {
      if (this.quality.fineType == '1') {
        this.$set(this.quality, 'partbFineAmount', 0)
      } else {
        if (this.quality.partbFineAmount) {
          if (isNaN(this.quality.partbFineAmount)) {
            this.$messageWorkReport.warning('按合同约定罚金请输入数值类型数据')
            this.$set(this.quality, 'partbFineAmount', '')
          }
        }
      }
    },
    changeSpFineAmount() {
      if (this.quality.spFineAmount) {
        if (isNaN(this.quality.spFineAmount)) {
          this.$messageWorkReport.warning('经审批扣罚金额请输入数值类型数据')
          this.$set(this.quality, 'spFineAmount', '')
        }
      }
    },
    changeFineType() {
      if (this.quality.fineType == '1') {
        this.$set(this.quality, 'partbFineAmount', 0)
      }
    },
  },
  watch: {
    qualityId(newV) {
      if (newV) {
        this.fetchQuality()
      }
    },
    taskId(newV) {
      if (newV) {
        this.fetchTask(newV)
      }
    },
  },
}
</script>

<style lang="less" scoped>
@import '~@assets/less/hte-main.less';
.page-main {
  .container {
    .content {
      margin-top: 20px;
      section {
        margin-bottom: 18px;
        .section-table {
          .add-btn {
            margin-left: 0;
            margin-bottom: 10px;
          }
          /deep/ .a-upload__input {
            display: none !important;
          }
        }
      }
    }
  }
  .tips-box {
    margin-top: 32px;
    .add-btn {
      width: 180px;
      height: 40px;
      line-height: 40px;
      background-color: #4095e4;
      border-radius: 2px;
    }
  }
}
/deep/ .el-upload__input {
  display: none !important;
}
</style>
